use soukoban::{direction::Direction, Actions, Map};

#[derive(Clone)]
pub struct Board {
    pub map: Map,
    actions: Actions,
    undone_actioins: Actions,
}

impl Board {

    pub fn with_map(map: Map) -> Self {
        Self { map, actions: Actions::new(), undone_actioins: Actions::new() }
    }
    pub fn actions(&self) -> &Actions{
        &self.actions
    }




    pub fn player_orientation(&self) -> Direction{
        self.actions
            .last()
            .map(|action| action.direction())
            .unwrap_or(Direction::Down)
    }
}